/*
 *@(#)RowMapperForTag.java 1.0 Mar 9, 2008
 *Copyright Fution Bai
 *
 */
package codebush.service.support.rowMapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.jdbc.support.rowset.SqlRowSet;

import codebush.domain.TagDataObject;

/**
 * 
 * @author Fution Bai
 * @since 1.0
 */
public class RowMapperForTag {

	private static RowMapperForTag rowMapperFortag;
	static {
		rowMapperFortag = new RowMapperForTag();
	}

	private RowMapperForTag() {
		;
	}

	public static RowMapperForTag getInstance() {
		return rowMapperFortag;
	}
	
	public List<TagDataObject> mapRow(SqlRowSet srs, int rowNum) {
	   List<TagDataObject> list = new ArrayList<TagDataObject>();
	   while (srs.next()) {
			TagDataObject tag= new TagDataObject();
			tag.setId(srs.getLong("id"));
			tag.setName(srs.getString("name"));
			list.add(tag);
		}
		return list;
	}
}
